package com.yang.action;

import com.yang.service.UserService;
import com.yang.util.RespEntity;
import com.yang.util.RespUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/yanZheng")
public class UserYanZhengAction extends HttpServlet {
    UserService userService = new UserService();
    //验证用户名是否可用
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("进来了");
        String login = req.getParameter("login");
        RespEntity respEntity = userService.yanzhengUser(login);
        RespUtil.sendJSON(resp, respEntity);
    }
}
